﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Supersense.db;
using Supersense.content;

public partial class admin_law_update : System.Web.UI.Page
{
    private Database db = new Database();
    private News obj = new News();
    public DataTable detail;
    public TreeView treeView = new TreeView();
    public DataTable subcategory;
    protected void Page_Load(object sender, EventArgs e)
    {
        string sql = "SELECT * FROM ss_product WHERE id=" + int.Parse(Request.QueryString["id"].ToString().Trim());
        DataView dv = this.db.executedv(sql);
        if (dv != null)
        {
            detail = dv.Table;
        }
        treeView = new TreeView();

        Crud modelCategory = new Crud("ss_category", "id");
        DataTable dt = modelCategory.fList("type='product' and upid = 0 ", "", "", "");
        if (dt != null)
        {
            foreach (DataRow dr in dt.Rows)
            {
                TreeNode tn = new TreeNode();
                tn.Text = dr["name"].ToString().Trim();
                tn.Value = dr["id"].ToString().Trim();
                treeView.Nodes.Add(tn);
            }
        }
        if (detail != null)
        {
            subcategory = modelCategory.fList("type='product' and upid = "+ detail.Rows[0]["type"], "", "", "");
        }

    }
}
